package com.study.design.model.behaviorPattern.iterator;

import org.junit.Test;

/**
* @Name: Client
* @Description: 迭代器测试类
* @Author: 李超	lc_jack@foxmail.com
* @CreateDate: 2017-2-15 下午4:15:23 
* @Version: V1.0
 */
public class Client {
	
	@Test
	public void iterator() {
		ConcreteMyAggregate cma = new ConcreteMyAggregate() ;
		cma.addElement("aa") ;
		cma.addElement("bb") ;
		cma.addElement("cc") ;
		MyIterator iterator = cma.createIterator() ;
		while(iterator.hasNext()) {
			System.out.println(iterator.getCurrentObject());
			iterator.next() ;
		}
	}

}
